package com.cjh.test.common;

import lombok.Data;

/**
 * @author ChenJunhong
 * @date 2018/12/07
 * Description:
 */
@Data
public class Response {
    private Integer code;
    private Object data;
    private String msg;

    public static Response success(){
        Response response = new Response();
        response.setCode(0);
        response.setMsg("操作成功！");
        return response;
    }

    public static Response success(Object data){
        Response response = new Response();
        response.setCode(0);
        response.setMsg("操作成功！");
        response.setData(data);
        return response;
    }

    public static Response fail(){
        Response response = new Response();
        response.setCode(-1);
        response.setMsg("操作失败！");
        return response;
    }
}
